#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSerialPort>
#include "sendpackthread.h"
#include "receivepackthread.h"
#include <QProgressBar>
#include <QLabel>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void monitor(); // 开始监控

    /*
    void updatePressure(QProgressBar* bar, QLabel* label, int value, bool warning);
    void updateWarningLabel();
    void updateTime();
    */
public slots:
    void updataUIData(char cmd,char param,int data);

private:
    Ui::MainWindow *ui;
    QSerialPort *serialPort = NULL; // 串口

    SendPackThread *sendPackThread = NULL;       // 串口发包线程
    ReceivePackThread *receivePackThread = NULL; // 串口接包线程

/*
    QGraphicsProxyWidget* m_needle;
    bool pressureStatus[6] = {false,};
    QPixmap pixNormalStaus;
    QPixmap pixWarningStatus;
    int pressThreshold; // 大于该值就要告警

private slots:
    void on_pushButtonAdd_clicked();

    void on_pushButtonSub_clicked();
    void setNeedleValue(double value);
*/
};
#endif // MAINWINDOW_H
